import request from '@/utils/request'

export function getDeviceModel(params) {
  return request({
    url: '/online/management/admin/manufacturer/products/tree', params, method: 'GET'
  })
}
export function getManufacturer() {
  return request({
    url: '/online/management/admin/manufacturer/select', method: 'GET'
  })
}
export function addManufacturer(params) {
  return request({
    url: '/online/management/admin/manufacturer', data: params,
    method: 'POST'
  })
}
export function getDeviceList(params) {
  return request({
    url: '/online/management/admin/device', params, method: 'GET'
  })
}

export function getDeviceBlacklistList(params) {
  return request({
    url: '/online/management/admin/device/blacklist', params, method: 'GET'
  })
}
export function switchNoSign(devSn, params) {
  return request({
    url: `/online/management/admin/device/blacklist/${devSn}/switch`, data: params,
    method: 'POST'
  })
}

export function getDeviceDetail(devId, params) {
  return request({
    url: `/online/management/admin/device/${devId}`, params, method: 'GET'
  })
}
export function getDeviceCmdHis(devId, params) {
  return request({
    url: `/online/management/admin/device/${devId}/cmd`, params, method: 'GET'
  })
}
export function verifyDeviceSn(devSn) {
  return request({
    url: `/online/management/admin/device/${devSn}/verify`, method: 'GET'
  })
}

export function querySystemParameterPage(devId, params) {
  return request({
    url: `/online/management/admin/device/${devId}/system-parameter`, params, method: 'GET'
  })
}
